alloc_netif() must return a ERR_PTR() on error, not NULL.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 18 Oct 2005 14:40:29 +0000 (15:40 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 18 Oct 2005 14:40:29 +0000 (15:40 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/netback/interface.c
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c

index 43f516badff187ab646c4be0327f2bb2979ce448..404eb98831fe507d4df6107cc724518bc4888bea 100644 (file)
@@ -58,7 +58,7 @@ netif_t *alloc_netif(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN])
        dev = alloc_netdev(sizeof(netif_t), name, ether_setup);
        if (dev == NULL) {
                DPRINTK("Could not create netif: out of memory\n");
-               return NULL;
+               return ERR_PTR(-ENOMEM);
        }
 
        netif = netdev_priv(dev);
@@ -104,7 +104,7 @@ netif_t *alloc_netif(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN])
                DPRINTK("Could not register new net device %s: err=%d\n",
                        dev->name, err);
                free_netdev(dev);
-               return NULL;
+               return ERR_PTR(err);
        }
 
        DPRINTK("Successfully created netif\n");
index 905ca8b80181a8b1a5c2d1ef398e1feee6aa260c..6d81bb743363995beab907a07d9474bcfaa58711 100644 (file)
@@ -28,10 +28,6 @@ struct backend_info
        netif_t *netif;
 
        long int frontend_id;
-#if 0
-       long int pdev;
-       long int readonly;
-#endif
 
        /* watch back end for changes */
        struct xenbus_watch backend_watch;
@@ -155,14 +151,6 @@ static void backend_changed(struct xenbus_watch *watch,
                        return;
                }
 
-#if 0
-               err = vbd_create(be->netif, handle, be->pdev, be->readonly);
-               if (err) {
-                       xenbus_dev_error(dev, err, "creating vbd structure");
-                       return;
-               }
-#endif
-
                kobject_hotplug(&dev->dev.kobj, KOBJ_ONLINE);
 
                /* Pass in NULL node to skip exist test. */